// Copyright 2021 Guoyoko. All Rights Reserved.

#include "Style/SWCoreStyle.h"
#include "Styling/CoreStyle.h"
#include "Styling/SlateStyleRegistry.h"
#include "Style/SWCoreStyleSet.h"


TSharedPtr<ISlateStyle> FSWCoreStyle::Instance = nullptr;

TSharedPtr<FWCoreStyleSet> FSWCoreStyle::Create()
{
	TSharedPtr<FWCoreStyleSet> NewStyleSet = MakeShareable(new FWCoreStyleSet());
	NewStyleSet->Initialize();
	FSlateStyleRegistry::RegisterSlateStyle(*NewStyleSet.Get());
	return NewStyleSet;
}

void FSWCoreStyle::Startup()
{
	Instance = Create();

}

void FSWCoreStyle::Shutdown()
{
	FSlateStyleRegistry::UnRegisterSlateStyle(*Instance.Get());
	Instance.Reset();
}

ISlateStyle& FSWCoreStyle::Get()
{
	return *(Instance.Get());
}

